package com.xgkj.diyiketang.task;

import com.alibaba.fastjson.JSONObject;
import com.xgkj.diyiketang.http.CouponHttpRequest;
import com.xgkj.diyiketang.http.CouponHttpResponse;
import com.xgkj.diyiketang.http.engine.CouponHttpBaseTask;
import com.xgkj.diyiketang.http.engine.TaskResultCode;

/**
 * Created by windo on 16/8/30.
 */
public class DeleteZhiboTask extends CouponHttpBaseTask {

    private String vid;

    @Override
    protected void processResponseData(CouponHttpResponse response) {
        notifyTaskCompleted(TaskResultCode.SUCCESS,null);
    }

    public DeleteZhiboTask(String id) {
        super();
        vid = id;
    }

    @Override
    protected void prepareRequest() {
        super.prepareRequest();
        if (mPhase == TASK_PHASE_INIT){
            CouponHttpRequest request = new CouponHttpRequest();
            request.setApiNo(ApiNo.ZHIBO_DELETE);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("vid",vid);
            request.setData(jsonObject.toString());
            addRequest(request);
        }
    }
}
